<?php

// Aug 19, 2010: immanuel192 write this modeler
// May 30, 2011 - trungdt - Fix when edit: select right current font

class cufon_item {
	// temporary build array for combobox
	
	function form($object) {
		$fonts=array("UTM Facebook K&T"=>"UTM Facebook K&T",
				 "UTM Duepuntozero"=>"UTM Duepuntozero",
				 "UTM Netmuc KT"=>"UTM Netmuc KT",
				 "UTM French Vanilla"=>"UTM French Vanilla",
                 "UTM Americana"=>"UTM Americana"
                 );
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();

		$form = new form();
		if (!isset($object->id)) {
			$object->font_name = '';
			$object->fontfile_name = '';
			$object->tag_name='';
			$object->fontsize=16;
		} else {
			$form->meta('id',$object->id);
		}
		
		$form->register('tag_name','Tag name',new textcontrol($object->tag_name));
		$form->register('fontsize','Font Size - In Pixel',new textcontrol($object->fontsize));
		$form->register('fontfile_name',"Convert to Font",new dropdowncontrol($object->font_name,$fonts));		
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function update($values,$object) {
		$object->tag_name = $values['tag_name'];
		$object->fontsize = intval($values['fontsize']);
		$object->fontfile_name = "UTM_Duepuntozero.font";
		$object->font_name = $values['fontfile_name'];
		return $object;
	}
}

?>
